<#assign sec=JspTaglibs["http://http://www.ahsj.link/security/tags"]/>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>通用后台管理模板系统</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="${request.contextPath}/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="${request.contextPath}/layuiadmin/style/admin.css" media="all">
    <link rel="stylesheet" href="${request.contextPath}/layuiadmin/style/common.css" media="all">
    <style>
        /* 定义自定义按钮样式 */
        .update-btn {
            /* 例如：为修改按钮添加背景色和边框 */
            background-color: #5FB878;
            border-color: #5FB878;
            color: white;
        }

        .delete-btn {
            /* 为删除按钮添加不同的背景色和边框 */
            background-color: #FF5722;
            border-color: #FF5722;
            color: white;
        }

        .invalidate-btn {
            /* 为作废按钮添加不同的背景色和边框 */
            background-color: #FFB800;
            border-color: #FFB800;
            color: white;
        }

        /* 可以添加悬停效果 */
        .update-btn:hover, .delete-btn:hover, .invalidate-btn:hover {
            opacity: 0.9;
        }
        #shadow {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            opacity: 0.1;
            z-index: 999; /* 提高z-index值 */
        }
    </style>
</head>
<body>

<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <@sec.authenticate grants="tract:contract:list">

                    <!-- 搜索条件start -->
                    <form class="layui-form layui-card-header layuiadmin-card-header-auto"
                         id="searchForm">
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label">参数</label>
                                <div class="layui-input-block input-box">
                                    <input type="text" name="parameterName" placeholder="请输入"
                                           autocomplete="off"
                                           class="layui-input">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">是否盖章</label>
                                <div class="layui-input-block input-box">
                                    <select name="affixSealStatus">
                                        <option value="">请选择</option>
                                        <option value="0">否</option>
                                        <option value="1">是</option>
                                    </select>
                                </div>
                            </div>

                            <div class="layui-inline">
                                <label class="layui-form-label">审核状态</label>
                                <div class="layui-input-block input-box">
                                        <select name="auditStatus" class="layui-select" lay-verify="required" lay-search>
                                            <option value="">请选择</option>
                                            <option value="0">未审核</option>
                                            <option value="1">审核通过</option>
                                            <option value="-1">审核不通过</option>
                                        </select>
                                </div>
                            </div>

                            <div class="layui-inline">
                                <label class="layui-form-label">是否作废</label>
                                <div class="layui-input-block input-box">
                                    <select name="nullifyStatus">
                                        <option value="">请选择</option>
                                        <option value="1">作废</option>
                                        <option value="0">在用</option>
                                    </select>
                                </div>
                            </div>


                            <div class="layui-inline">
                                <button type="button" class="layui-btn layui-btn-normal" id="SearchBtn"
                                        data-type="reload">搜索
                                </button>
                                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                            </div>
                        </div>
                    </form>
                    <!-- 搜索条件end -->
                </@sec.authenticate>


                <!-- 数据表格start -->
                <div class="layui-card-body">
                    <table class="layui-hide" id="List" lay-filter="List-toolbar"></table>

                    <script type="text/html" id="List-toolbar">
                        <div class="layui-btn-container">
                            <@sec.authenticate grants="tract:contract:add">
                                <button class="layui-btn layui-btn-sm layui-btn-primary"
                                        lay-event="add"><i class="layui-icon">&#xe654;</i>新增
                                </button>
                            </@sec.authenticate>
                            <button class="layui-btn layui-btn-sm layui-btn-primary" lay-event="import"><i
                                        class="layui-icon">&#xe67c;</i>导入
                            </button>

                            <button class="layui-btn layui-btn-sm layui-btn-primary"
                                    lay-event="export"><i class="layui-icon">&#xe67d;</i>导出
                            </button>
                        </div>
                    </script>

                    <script type="text/html" id="List-editBar">
                        <@sec.authenticate grants="tract:contract:update">
                            <a class="layui-btn layui-btn-xs layui-btn-normal update-btn" lay-event="update">
                                <i class="layui-icon">&#xe642;</i>修改
                            </a>
                        </@sec.authenticate>
                        <@sec.authenticate grants="tract:contract:delete">
                            <a class="layui-btn layui-btn-xs layui-btn-danger delete-btn" lay-event="delete">
                                <i class="layui-icon">&#xe640;</i>删除
                            </a>
                        </@sec.authenticate>

                            <a class="layui-btn layui-btn-xs layui-btn-warm invalidate-btn" lay-event="invalidate">
                                <i class="layui-icon">&#xe656;</i>作废
                            </a>

                    </script>
                </div>
                <!-- 数据表格end -->
            </div>
        </div>
    </div>
</div>
<div id="shadow">
    <!-- 特效canvas -->
    <canvas id="canvas" style="width: 100%; height: 100%;"></canvas>
    <!-- 特效JavaScript -->
    <script>
        // 特效JavaScript代码（请将特效代码中的所有`canvas`元素ID替换为`canvas特效覆盖层`）
        // 特效代码省略，因为内容较多，直接放在此处
        function project3D(x,y,z,vars){
            var p,d;
            x-=vars.camX;
            y-=vars.camY-8;
            z-=vars.camZ;
            p=Math.atan2(x,z);
            d=Math.sqrt(x*x+z*z);
            x=Math.sin(p-vars.yaw)*d;
            z=Math.cos(p-vars.yaw)*d;
            p=Math.atan2(y,z);
            d=Math.sqrt(y*y+z*z);
            y=Math.sin(p-vars.pitch)*d;
            z=Math.cos(p-vars.pitch)*d;
            var rx1=-1000;
            var ry1=1;
            var rx2=1000;
            var ry2=1;
            var rx3=0;
            var ry3=0;
            var rx4=x;
            var ry4=z;
            var uc=(ry4-ry3)*(rx2-rx1)-(rx4-rx3)*(ry2-ry1);
            var ua=((rx4-rx3)*(ry1-ry3)-(ry4-ry3)*(rx1-rx3))/uc;
            var ub=((rx2-rx1)*(ry1-ry3)-(ry2-ry1)*(rx1-rx3))/uc;
            if(!z)z=0.000000001;
            if(ua>0&&ua<1&&ub>0&&ub<1){
                return {
                    x:vars.cx+(rx1+ua*(rx2-rx1))*vars.scale,
                    y:vars.cy+y/z*vars.scale,
                    d:(x*x+y*y+z*z)
                };
            }else{
                return { d:-1 };
            }
        }
        function elevation(x,y,z){
            var dist = Math.sqrt(x*x+y*y+z*z);
            if(dist && z/dist>=-1 && z/dist <=1) return Math.acos(z / dist);
            return 0.00000001;
        }
        function rgb(col){
            col += 0.000001;
            var r = parseInt((0.5+Math.sin(col)*0.5)*16);
            var g = parseInt((0.5+Math.cos(col)*0.5)*16);
            var b = parseInt((0.5-Math.sin(col)*0.5)*16);
            return "#"+r.toString(16)+g.toString(16)+b.toString(16);
        }
        function interpolateColors(RGB1,RGB2,degree){
            var w2=degree;
            var w1=1-w2;
            return [w1*RGB1[0]+w2*RGB2[0],w1*RGB1[1]+w2*RGB2[1],w1*RGB1[2]+w2*RGB2[2]];
        }
        function rgbArray(col){
            col += 0.000001;
            var r = parseInt((0.5+Math.sin(col)*0.5)*256);
            var g = parseInt((0.5+Math.cos(col)*0.5)*256);
            var b = parseInt((0.5-Math.sin(col)*0.5)*256);
            return [r, g, b];
        }
        function colorString(arr){
            var r = parseInt(arr[0]);
            var g = parseInt(arr[1]);
            var b = parseInt(arr[2]);
            return "#"+("0" + r.toString(16) ).slice (-2)+("0" + g.toString(16) ).slice (-2)+("0" + b.toString(16) ).slice (-2);
        }
        function process(vars){
            if(vars.points.length<vars.initParticles) for(var i=0;i<5;++i) spawnParticle(vars);
            var p,d,t;
            p = Math.atan2(vars.camX, vars.camZ);
            d = Math.sqrt(vars.camX * vars.camX + vars.camZ * vars.camZ);
            d -= Math.sin(vars.frameNo / 80) / 25;
            t = Math.cos(vars.frameNo / 300) / 165;
            vars.camX = Math.sin(p + t) * d;
            vars.camZ = Math.cos(p + t) * d;
            vars.camY = -Math.sin(vars.frameNo / 220) * 15;
            vars.yaw = Math.PI + p + t;
            vars.pitch = elevation(vars.camX, vars.camZ, vars.camY) - Math.PI / 2;
            var t;
            for(var i=0;i<vars.points.length;++i){
                x=vars.points[i].x;
                y=vars.points[i].y;
                z=vars.points[i].z;
                d=Math.sqrt(x*x+z*z)/1.0075;
                t=.1/(1+d*d/5);
                p=Math.atan2(x,z)+t;
                vars.points[i].x=Math.sin(p)*d;
                vars.points[i].z=Math.cos(p)*d;
                vars.points[i].y+=vars.points[i].vy*t*((Math.sqrt(vars.distributionRadius)-d)*2);
                if(vars.points[i].y>vars.vortexHeight/2 || d<.25){
                    vars.points.splice(i,1);
                    spawnParticle(vars);
                }
            }
        }
        function drawFloor(vars){
            var x,y,z,d,point,a;
            for (var i = -25; i <= 25; i += 1) {
                for (var j = -25; j <= 25; j += 1) {
                    x = i*2;
                    z = j*2;
                    y = vars.floor;
                    d = Math.sqrt(x * x + z * z);
                    point = project3D(x, y-d*d/85, z, vars);
                    if (point.d != -1) {
                        size = 1 + 15000 / (1 + point.d);
                        a = 0.15 - Math.pow(d / 50, 4) * 0.15;
                        if (a > 0) {
                            vars.ctx.fillStyle = colorString(interpolateColors(rgbArray(d/26-vars.frameNo/40),[0,128,32],.5+Math.sin(d/6-vars.frameNo/8)/2));
                            vars.ctx.globalAlpha = a;
                            vars.ctx.fillRect(point.x-size/2,point.y-size/2,size,size);
                        }
                    }
                }
            }
            vars.ctx.fillStyle = "#82f";
            for (var i = -25; i <= 25; i += 1) {
                for (var j = -25; j <= 25; j += 1) {
                    x = i*2;
                    z = j*2;
                    y = -vars.floor;
                    d = Math.sqrt(x * x + z * z);
                    point = project3D(x, y+d*d/85, z, vars);
                    if (point.d != -1) {
                        size = 1 + 15000 / (1 + point.d);
                        a = 0.15 - Math.pow(d / 50, 4) * 0.15;
                        if (a > 0) {
                            vars.ctx.fillStyle = colorString(interpolateColors(rgbArray(-d/26-vars.frameNo/40),[32,0,128],.5+Math.sin(-d/6-vars.frameNo/8)/2));
                            vars.ctx.globalAlpha = a;
                            vars.ctx.fillRect(point.x-size/2,point.y-size/2,size,size);
                        }
                    }
                }
            }
        }
        function sortFunction(a,b){
            return b.dist-a.dist;
        }
        function draw(vars){
            vars.ctx.globalAlpha=.15;
            vars.ctx.fillStyle="#000";
            vars.ctx.fillRect(0, 0, canvas.width, canvas.height);
            drawFloor(vars);
            var point,x,y,z,a;
            for(var i=0;i<vars.points.length;++i){
                x=vars.points[i].x;
                y=vars.points[i].y;
                z=vars.points[i].z;
                point=project3D(x,y,z,vars);
                if(point.d != -1){
                    vars.points[i].dist=point.d;
                    size=1+vars.points[i].radius/(1+point.d);
                    d=Math.abs(vars.points[i].y);
                    a = .8 - Math.pow(d / (vars.vortexHeight/2), 1000) * .8;
                    vars.ctx.globalAlpha=a>=0&&a<=1?a:0;
                    vars.ctx.fillStyle=rgb(vars.points[i].color);
                    if(point.x>-1&&point.x<vars.canvas.width&&point.y>-1&&point.y<vars.canvas.height)vars.ctx.fillRect(point.x-size/2,point.y-size/2,size,size);
                }
            }
            vars.points.sort(sortFunction);
        }
        function spawnParticle(vars){

            var p,ls;
            pt={};
            p=Math.PI*2*Math.random();
            ls=Math.sqrt(Math.random()*vars.distributionRadius);
            pt.x=Math.sin(p)*ls;
            pt.y=-vars.vortexHeight/2;
            pt.vy=vars.initV/20+Math.random()*vars.initV;
            pt.z=Math.cos(p)*ls;
            pt.radius=200+800*Math.random();
            pt.color=pt.radius/1000+vars.frameNo/250;
            vars.points.push(pt);
        }
        function frame(vars) {
            if(vars === undefined){
                var vars={};
                vars.canvas = document.querySelector("canvas");
                vars.ctx = vars.canvas.getContext("2d");
                vars.canvas.width = document.body.clientWidth;
                vars.canvas.height = document.body.clientHeight;
                window.addEventListener("resize", function(){
                    vars.canvas.width = document.body.clientWidth;
                    vars.canvas.height = document.body.clientHeight;
                    vars.cx=vars.canvas.width/2;
                    vars.cy=vars.canvas.height/2;
                }, true);
                vars.frameNo=0;

                vars.camX = 0;
                vars.camY = 0;
                vars.camZ = -14;
                vars.pitch = elevation(vars.camX, vars.camZ, vars.camY) - Math.PI / 2;
                vars.yaw = 0;
                vars.cx=vars.canvas.width/2;
                vars.cy=vars.canvas.height/2;
                vars.bounding=10;
                vars.scale=500;
                vars.floor=26.5;

                vars.points=[];
                vars.initParticles=700;
                vars.initV=.01;
                vars.distributionRadius=800;
                vars.vortexHeight=25;
            }
            vars.frameNo++;
            requestAnimationFrame(function() {
                frame(vars);
            });
            process(vars);
            draw(vars);
        }
        frame();
    </script>
</div>
<script src="${request.contextPath}/layuiadmin/layui/layui.js"></script>
<script src="${request.contextPath}/layui-extend.js"></script>
<script src="${request.contextPath}/webjars/jquery/jquery.min.js"></script>
<script src="${request.contextPath}/fileDownload/jquery.fileDownload.min.js"></script>
<script type="text/javascript" src="${request.contextPath}/scripts/tract/contract/list.js?_=${randomNum}"></script>
</body>
</html>
